<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>搜索数据库</title>
<link href="resources/jquery-pager/Pager.css" rel="stylesheet" type="text/css" />
<link href="resources/css/bd.css" rel="stylesheet" type="text/css" />
<script src="resources/js/jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="resources/jquery-pager/jquery.pager.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
         //pagenumber 为当前页码
         //pagecount 为显示页数
         //PageClick 为回调函数
         //pageclickednumber 为点击页码
        $(document).ready(function() {
        	if(${pageModel.totalPage >1}){
       		 $("#pager").pager({ 
                	pagenumber: "${pageModel.currentPage}", 
                	pagecount: "${pageModel.totalPage}", 
                	buttonClickCallback: function(page){
                		window.location.href="s.htm?page="+page+"&search=${search}";
                	}
                });
       		}
        });
         
</script>
</head>
<body link="#0000cc">
<div id="out">
	<div id="in">
		<div id="wrapper">
			<div id="head">
				<form action="s.htm" class="fm">
					<span class="s_ipt_wr">
						<input type="text" class="s_ipt" id="textInput" name="search" value="${search }" maxlength="100" autocomplete="off">
					</span>
					<span class="s_btn_wr">
						<input type="submit" id="su" value="搜一下" class="s_btn" onmousedown="this.className='s_btn s_btn_h'" onmouseout="this.className='s_btn'">
					</span>	
						
					
				</form>
			</div>
			<br>
			<div id="container">
				<c:if test="${not empty pageModel.list }">
					<c:forEach items="${pageModel.list }" var="item">
						<table class="result-op" cellpadding="0" cellspacing="0">
							<tbody>
								<tr>
									<td class="f">
										<h3 class="t"><a href="#"><c:if test="${not empty item.title }">${item.title }</c:if> <c:if test="${ empty item.title }">${item.id }</c:if></a></h3>
										<span class="tsuf tsuf-op" ></span>
										<div style="padding-top:3px;">
											<font size="-1">
												<p>${item.text }</p>
												<div></div>
												<span style="font-size:13px;"><span style="color:#008000"></span></span>
											</font>
										</div>
										
									</td>
								</tr>
							</tbody>
						</table>
						<br>
					</c:forEach>
					<br clear="all">
					<p id="pager"></p>
					<span class="nums" style="margin-left:120px">为您找到相关结果为${pageModel.totalRecord }个</span>
				</c:if>
			</div>
			<br>
			<br>
			<div id="foot"></div>
		</div>
	</div>
</div>
</body>

</html>